package com.example.payment2.service.impl;

import com.example.comment.entity.Payment;
import com.example.payment2.mapper.PaymentMapper;
import com.example.payment2.service.PaymentService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author kuang
 * @Date 2021/7/11 18:09
 */
@Service
public class PaymentServiceImpl implements PaymentService {

    @Resource
    private PaymentMapper paymentMapper;

    /**
     * 新增支付
     *
     * @param payment 支付
     * @return flag
     */
    @Override
    public int addPayment(Payment payment) {
        return paymentMapper.addPayment(payment);
    }

    /**
     * 查询支付
     *
     * @param id id
     * @return 支付
     */
    @Override
    public Payment queryPayment(Long id) {
        return paymentMapper.queryPayment(id);
    }

    /**
     * 修改支付信息
     *
     * @param payment 支付
     * @return flag
     */
    @Override
    public int modifyPayment(Payment payment) {
        return paymentMapper.modifyPayment(payment);
    }

    /**
     * 删除支付信息
     *
     * @param id id
     * @return flag
     */
    @Override
    public int deletePayment(Long id) {
        return paymentMapper.deletePayment(id);
    }
}
